package com.swh.controller.system;

import com.github.pagehelper.PageInfo;
import com.swh.entity.QualificationCondition;
import com.swh.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/12/28 16:21
 * @Version: 1.0
 */
@Controller
@RequestMapping("/guguanjia/sysLog")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    @RequestMapping("/index")
    public String login() {
        return "/log/log";
    }

    @RequestMapping("/toUpdate")
    public String toUpdate() {
        return "/log/log-detail";
    }

    @ResponseBody
    @RequestMapping("/selectPage/{pageNum}/{pageSize}")
    public PageInfo<Map> selectPage(@PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize,
                                    QualificationCondition condition) {
        return sysLogService.selectPage(pageNum, pageSize, condition);
    }

    @ResponseBody
    @RequestMapping("/deleteById/{id}")
    public void deleteById(@PathVariable("id") Integer id) {
        sysLogService.delete(id);
    }



}
